<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:with="title='机构',active='agency'">
<header th:replace="comm/header::headerFragment(${title},${active})"></header>
<link th:href="@{/admin/plugins/tagsinput/jquery.tagsinput.css}" rel="stylesheet"/>
<link th:href="@{/admin/plugins/select2.dist.css/select2-bootstrap.css}" rel="stylesheet"/>
<link th:href="@{/admin/plugins/toggles/toggles.css}" rel="stylesheet"/>
<link th:href="@{/admin/plugins/md/css/style.css}" rel="stylesheet"/>
<link th:href="@{/plugins/dropzone/dropzone.css}" rel="stylesheet"/>
<!-- editor.md -->
<link th:href="@{/plugins/nice-validator-0.8.1/jquery.validator.css}" rel="stylesheet"/>
<style>
    #tags_tagsinput {
        background-color: #fafafa;
        border: 1px solid #eeeeee;
    }

    #tags_addTag input {
        width: 100%;
    }

    #tags_addTag {
        margin-top: -5px;
    }
    
     #dropzone {
        margin-bottom: 3rem;
    }

    .dropzone {
        border: 2px dashed #0087F7;
        border-radius: 5px;
        background: white;
    }

    .dropzone .dz-message {
        font-weight: 400;
    }

    .dropzone .dz-message .note {
        font-size: 0.8em;
        font-weight: 200;
        display: block;
        margin-top: 1.4rem;
    }

    .attach-img {
        width: 100px;
        height: 100px;
        border-radius: 10px;
        box-shadow: 0px 0px 8px #333;
    }

    .attach-text {
        font-size: 12px;
        font-weight: 300;
    }

    .attach-img:hover {
        background-color: #f9f9f9;
    }
    .n-invalid {border:1px solid #c00;}
</style>

<body class="fixed-left">
<div id="wrapper">
    <div th:replace="comm/header::header-body"></div>
    <div class="content-page">
        <div class="content">
            <div class="container">
                <div class="row">
                    <div class="col-sm-12">
                        <h4 class="page-title">
                            <th:block th:if="${null != contents}">
                                单位介绍
                            </th:block>
                            <th:block th:unless="${null != contents}">
                                单位介绍
                            </th:block>
                        </h4>
                    </div>
                    <div class="col-md-8">
                                <form class="form-horizontal" role="form" id="global-form" autocomplete="off" data-validator-option="{timely:1, focusCleanup:true}">
                                    <input th:value="${id}" id="id" type="text" name="id" style="display: none;">
                                    <div class="form-group">
                                        <label class="col-sm-1 control-label">单位名称</label>
                                        <div class="col-md-6">
                                            <input type="text" class="form-control" name="name" placeholder="单位名称"
                                                  required="required" aria-required="true"/>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                     <label class="col-sm-1 control-label">单位图片</label>
                                    <div class="col-md-6">
                                        <span>将文件拖至此处或点击空白处上传</span>
                                   <div  class="dropzone" id="dropzone">
                                    <div class="fallback">
                                        <input name="file" type="file" multiple="multiple"/>
                                    </div>
                                    <input name="files" id="image_files" style="display: none;">
                                    <!--<div class="dz-message">-->
                                                                                              <!--将文件拖至此处或点击上传-->
                                    <!--</div>-->
                                    </div>
                                     </div>
                                    </div>
                                   <div class="form-group">
                                        <label class="col-sm-1 control-label">所在地</label>
                                           <div class="col-sm-2">
                                        <select class="form-control" id="city"  name="cityCode" onchange="cityChange(this.value)">
                                        
                                        </select>
                                        </div>
                                      <div class="col-sm-2">
                                         <select class="form-control" id="county" name="countyCode" onchange="countyChange(this.value)">
                                        </select>
                                        </div>
                                       <div class="col-sm-2">
                                         <select class="form-control" id="street" name="streetCode" >
                                        </select>
                                        </div>
                                   </div>
                                    <div class="form-group">
                                        <label class="col-sm-1 control-label">详细地址</label>
                                        <div class="col-md-8">
                                            <input type="text" class="form-control" name="detailAddress" placeholder="所在地"
                                                  required="required" aria-required="true"/>
                                        </div>
                                   </div>
                                    <div class="form-group">
                                        <label class="col-sm-1 control-label">经纬度</label>
                                        <div class="col-md-3">
                                        <input type="text" value="" id="map" name="remark2" class="form-control" readonly="readonly">
                                        </div>
                                        <div class="col-md-3">
                                        <a class="btn btn-primary" onclick="createMap()">地图位置</a>
                                        </div>
                                   </div>
                            <div class="clearfix"></div>
                            <div class="form-group">
                             <label class="col-sm-1 control-label">详细介绍</label>
                             <div class="col-md-8">
								<script type="text/plain" id="container" name="content" style="width:650px;height:500px;"></script>
								</div>
							</div>
                            <div class="clearfix"></div>
                            <div class="text-center">
                                 <a  th:href="@{/agency/org/index}" class="btn btn-primary waves-effect waves-light">
                                   	 	取消
                                </a>
                                <button type="submit" class="btn btn-primary waves-effect waves-light"
                                        onclick="submitForm()">
                                   	 	保 存
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
                <div th:replace="comm/footer :: footer-content"></div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="mapModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
			<h4 class="modal-title" id="myModalLabel">百度地图选点(鼠标滚动缩放地图,鼠标拖动移动地图)</h4>
		</div>
		<div class="modal-body" id="map_main" style="height:400px;">在这里添加一些文本</div>
		<div class="modal-footer">
			<input style="width:300px;float:left;" type="text" value="" id="map_txt" class="form-control" readonly=""/>
			<button type="button" class="btn btn-primary" onclick="setMapValue()">设置为此地址</button>
			<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
		</div>
	</div>
	</div>
</div>
<div th:replace="comm/footer :: footer"></div>
<script th:src="@{/plugins/dropzone/dropzone.js}"></script>
<script type="text/javascript" th:src="@{/plugins/ueditor1_4_3-utf8-jsp/ueditor.config.js}"></script>
<script type="text/javascript" th:src="@{/plugins/ueditor1_4_3-utf8-jsp/ueditor.all.js}"></script>
<script type="text/javascript" th:src="@{/plugins/ueditor1_4_3-utf8-jsp/lang/zh-cn/zh-cn.js}"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=2d12993ce41407db4050140fe342d9ba"></script> 
<script type="text/javascript">
        Dropzone.autoDiscover = false;
        var ue = UE.getEditor('container');
</script>
<script th:src="@{/admin/plugins/tagsinput/jquery.tagsinput.min.js}"></script>
<!-- editor.md -->
<script th:src="@{//cdn.bootcss.com/jquery-toggles/2.0.4/toggles.min.js}"></script>
<script th:src="@{/plugins/nice-validator-0.8.1/jquery.validator.js}"></script>
<script th:src="@{/plugins/nice-validator-0.8.1/zh-CN.js}"></script>
<script th:src="@{/plugins/UMBinding.js}"></script>
<script th:src="@{/plugins/jQuery-ext/serializeObject.js}"></script>
<script th:src="@{/plugins/areas.js}"></script>
<script th:src="@{/js/agency/org/create.js}"></script>
</body>
</html>